package psn.kiko.scheduled;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 *Execute the annotated method with a fixed period in milliseconds between invocations.
 */
@Component
@Slf4j
public class FixedRateTask{
	//两次调用之间间隔5秒
	@Scheduled(fixedRate=1000*5,initialDelay=1000*5)
	public void task(){
		log.debug("fixedRate指定的定时任务{}",LocalDateTime.now());
	}
}
